/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 2e5 + 2;

int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    for (int i = n; i >= n - i + 1; --i) {
      if (i != n - i + 1)
        cout << i << ' ' << n - i + 1 << ' ';
      else
        cout << i;
    }
    cout << endl;
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("B. Koxia and Permutation.in", "r", stdin);
  freopen("B. Koxia and Permutation.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
